home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / LITTLE / P3SRC.ZIP / ATARI / TEXTURE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-25  |  4.2 KB  |  112 lines

  1. /****************************************************************************
  2. *                   texture.h
  3. *
  4. *  This file contains defines and variables for the txt*.c files
  5. *
  6. *  from Persistence of Vision(tm) Ray Tracer
  7. *  Copyright 1996 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. *  NOTICE: This source code file is provided so that users may experiment
  10. *  with enhancements to POV-Ray and to port the software to platforms other
  11. *  than those supported by the POV-Ray Team.  There are strict rules under
  12. *  which you are permitted to use this file.  The rules are in the file
  13. *  named POVLEGAL.DOC which should be distributed with this file. If
  14. *  POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. *  Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  16. *  Forum.  The latest version of POV-Ray may be found there as well.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23.  
  24. /* NOTE: FRAME.H contains other texture stuff. */
  25.  
  26. #ifndef TEXTURE_H
  27. #define TEXTURE_H
  28.  
  29. #include "pattern.h"
  30. #include "warps.h"
  31.  
  32. /*****************************************************************************
  33. * Global preprocessor defines
  34. ******************************************************************************/
  35.  
  36. #define RNDMASK       0x7FFF
  37. #define RNDMULTIPLIER ((DBL)0.000030518509476)
  38.  
  39. /*
  40.  * Macro to create random number in the [0; 1] range.
  41.  */
  42.  
  43. #define FRAND() ((DBL)POV_RAND()*RNDMULTIPLIER)
  44.  
  45. #define FLOOR(x)  ((x) >= 0.0 ? floor(x) : (0.0 - floor(0.0 - (x)) - 1.0))
  46.  
  47. #define Hash3d(a,b,c) \
  48.   hashTable[(int)(hashTable[(int)(hashTable[(int)((a) & 0xfffL)] ^ ((b) & 0xfffL))] ^ ((c) & 0xfffL))]
  49.  
  50. #define Hash2d(a,b)   \
  51.   hashTable[(int)(hashTable[(int)((a) & 0xfffL)] ^ ((b) & 0xfffL))]
  52.  
  53. #define Hash1d(a,b)   \
  54.   hashTable[(int)(a) ^ ((b) & 0xfffL)]
  55.  
  56. #define INCRSUM(m,s,x,y,z)  \
  57.   ((s)*(RTable[m]*0.5 + RTable[m+1]*(x) + RTable[m+2]*(y) + RTable[m+3]*(z)))
  58.  
  59. #define INCRSUMP(mp,s,x,y,z) \
  60.   ((s)*((mp[0])*0.5 + (mp[1])*(x) + (mp[2])*(y) + (mp[3])*(z)))
  61.  
  62.  
  63. /*****************************************************************************
  64. * Global typedefs
  65. ******************************************************************************/
  66.  
  67.  
  68.  
  69. /*****************************************************************************
  70. * Global variables
  71. ******************************************************************************/
  72.  
  73. extern short *hashTable;
  74. extern DBL *frequency;               /* dmf */
  75. extern unsigned int Number_Of_Waves; /* dmf */
  76. extern VECTOR *Wave_Sources;         /* dmf */
  77.  
  78.  
  79.  
  80. /*****************************************************************************
  81. * Global functions
  82. ******************************************************************************/
  83.  
  84. void Compute_Colour PARAMS((COLOUR Colour,PIGMENT *Pigment, DBL value));
  85. void Initialize_Noise PARAMS((void));
  86. void Free_Noise_Tables PARAMS((void));
  87. DBL Noise PARAMS((VECTOR EPoint));
  88. void DNoise PARAMS((VECTOR result, VECTOR EPoint));
  89. DBL Turbulence PARAMS((VECTOR EPoint, TURB *Turb));
  90. void DTurbulence PARAMS((VECTOR result, VECTOR EPoint, TURB *Turb));
  91. DBL cycloidal PARAMS((DBL value));
  92. DBL Triangle_Wave PARAMS((DBL value));
  93. void Translate_Textures PARAMS((TEXTURE *Textures, TRANSFORM *Trans));
  94. void Rotate_Textures PARAMS((TEXTURE *Textures, TRANSFORM *Trans));
  95. void Scale_Textures PARAMS((TEXTURE *Textures, TRANSFORM *Trans));
  96. void Transform_Textures PARAMS((TEXTURE *Textures, TRANSFORM *Trans));
  97. void Destroy_Textures PARAMS((TEXTURE *Textures));
  98. void Post_Textures PARAMS((TEXTURE *Textures));
  99. FINISH *Create_Finish PARAMS((void));
  100. FINISH *Copy_Finish PARAMS((FINISH *Old));
  101. TEXTURE *Create_PNF_Texture PARAMS((void));
  102. TEXTURE *Copy_Texture_Pointer PARAMS((TEXTURE *Texture));
  103. TEXTURE *Copy_Textures PARAMS((TEXTURE *Textures));
  104. TEXTURE *Create_Texture PARAMS((void));
  105. int Test_Opacity PARAMS((TEXTURE *Texture));
  106. TURB *Create_Turb PARAMS((void));
  107. int POV_Std_rand PARAMS((void));
  108. void POV_Std_srand PARAMS((int seed));
  109.  
  110.  
  111. #endif
  112.